package org.nepu.scr.indexrate.converter.compliancerate.datacompleteness.drillingdevice;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.datacompleteness.DrillingMachineMenu1_5;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class DrillingMachineMenuConverter1_5 implements AttributeConverter<DrillingMachineMenu1_5, String> {
    @Override
    public String convertToDatabaseColumn(DrillingMachineMenu1_5 drillingMachineMenu) {
        return JSONUtil.toJsonStr(drillingMachineMenu);
    }

    @Override
    public DrillingMachineMenu1_5 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, DrillingMachineMenu1_5.class);
    }
}
